
#pragma once
#include <QApplication>
#include <QPushButton>


#include "Create_Project/header/Create_Project_D.h"
#include "Create_Table/header/Create_Table.h"
#include "New_Table/header/New_Table.h"
#include "Open_File_Dialog/header/Open_File_Dialog.h"
#include "Descriptive_Widget/header/Descriptive_Widget.h"


#include "Chart/header/Scatter_Plot.h"




int main(int argc, char *argv[]) {
    QApplication a(argc, argv);

    Create_Project* create_project = new Create_Project();
    Create_Table* create_table = new Create_Table();
    New_Table* new_table = new New_Table();
    Open_File_Dialog* open_file_dialog{new Open_File_Dialog()};


    create_project->show();


    QObject::connect(create_project->Get_C_P_B(), &QPushButton::clicked, create_table, &QWidget::show);
    QObject::connect(create_project->Get_C_P_B(), &QPushButton::clicked, create_project, &QWidget::hide);


    QObject::connect(create_table->Get_G_B(), &QPushButton::clicked, create_project, &QWidget::show);
    QObject::connect(create_table->Get_G_B(), &QPushButton::clicked, create_table, &QWidget::hide);




    open_file_dialog->Set_Table(new_table);
    QObject::connect(create_project->Get_O_F(), &QPushButton::clicked, open_file_dialog, &QWidget::show);
    QObject::connect(create_project->Get_O_F(), &QPushButton::clicked, create_project, &QWidget::close);


    create_table->Set_Table_Object(new_table);
    QObject::connect(create_table->Get_O_B(), &QPushButton::clicked, create_table, &Create_Table::Table_Size);
    QObject::connect(create_table->Get_O_B(), &QPushButton::clicked, create_project, &QWidget::close);
    QObject::connect(create_table->Get_O_B(), &QPushButton::clicked, create_table, &QWidget::close);
    QObject::connect(create_table->Get_O_B(), &QPushButton::clicked, new_table, &QWidget::show);


    QObject::connect(open_file_dialog->open_button, &QPushButton::clicked, open_file_dialog, &Open_File_Dialog::Check_Click);
    QObject::connect(open_file_dialog->open_button, &QPushButton::clicked, new_table, &New_Table::Read_CSV);
    QObject::connect(open_file_dialog->open_button, &QPushButton::clicked, new_table, &QWidget::show);
    QObject::connect(open_file_dialog->open_button, &QPushButton::clicked, open_file_dialog, &QWidget::close);




    return QApplication::exec();
}
